print(tuple(range(10)))  # (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
print(list(range(1, 10)))   # [1, 2, 3, 4, 5, 6, 7, 8, 9]
print(list(range(1, 10, 2)))  # [1, 3, 5, 7, 9]

# 水仙花数。三位数，每一位数字的立方和 = 三位数本身
# 方法一:自己算
for i in range(100, 1000):
    units = i % 10
    tens = i % 100 // 10
    hundreds = i // 100
    if units ** 3 + tens ** 3 + hundreds ** 3 == i:
        print("水仙花数：%d" %i)
print()
# 方法二:利用str()
for i in range(100, 1000):
    t = str(i)
    units = int(t[2])
    tens = int(t[1])
    hundreds = int(t[0])
    if units ** 3 + tens ** 3 + hundreds ** 3 == i:
        print("水仙花数：%d" %i)